package pl.lodz.p.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Transient;

@Entity
public class NotificationConfiguration {

	@Transient
	private static final int ONE_HOUR = 1;
	@Transient
	private static final int SIX_HOUR = 6;
	@Transient
	private static final int TWELVE_HOUR = 12;
	@Transient
	private static final int ONE_DAY = 24;
	@Transient
	private static final int TWO_DAYS = 48;
	@Transient
	private static final int THREE_DAYS = 72;
	@Transient
	private static final int ONE_WEEK = 168;
	@Transient
	public static final int[] POSSIBILITIES = { ONE_HOUR, SIX_HOUR,
			TWELVE_HOUR, ONE_DAY, TWO_DAYS, THREE_DAYS, ONE_WEEK };
	
	public NotificationConfiguration() {
		super();
	}
	
	public NotificationConfiguration(User user) {
		super();
		this.user = user;
	}
	
	@Id
	@GeneratedValue
	private int id;
	
	@Column
	private int smsHoursBefore;
	
	@Column
	private int emailHoursBefore;
	
	@OneToOne
	@PrimaryKeyJoinColumn 
	private User user;

	public int getSmsHoursBefore() {
		return smsHoursBefore;
	}

	public void setSmsHoursBefore(int smsHoursBefore) {
		this.smsHoursBefore = smsHoursBefore;
	}

	public int getEmailHoursBefore() {
		return emailHoursBefore;
	}

	public void setEmailHoursBefore(int emailHoursBefore) {
		this.emailHoursBefore = emailHoursBefore;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

}
